package com.tx.studentManager.model;

import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

import org.hibernate.annotations.DynamicInsert;
import org.hibernate.annotations.DynamicUpdate;
import org.hibernate.annotations.GenericGenerator;


@Entity
@Table(name="studentClass",catalog = "studentManager")
@DynamicInsert(true)
@DynamicUpdate(true)
public class StudentClass extends BaseModel  {

	private static final long serialVersionUID = 1L;

	/**
	 * 班级Id
	 */
	@Id
	@Column(nullable = false,length = 32)
	@GenericGenerator(name="StrGenerator",strategy="uuid")
	@GeneratedValue(generator="StrGenerator")
	private String classId;
	
	@Column(length = 16)
	private String className;
	
	@ManyToOne
    @JoinColumn(name = "majorId",insertable= true , nullable=true)
	private Major major;
	
	@Column(nullable = false)
	private Date createDate;
	
	public String getClassId() {
		return classId;
	}
	public void setClassId(String classId) {
		this.classId = classId;
	}
	public String getClassName() {
		return className;
	}
	public void setClassName(String className) {
		this.className = className;
	}
	public Date getCreateDate() {
		return createDate;
	}
	public void setCreateDate(Date createDate) {
		this.createDate = createDate;
	}
	public Major getMajor() {
		return major;
	}
	public void setMajor(Major major) {
		this.major = major;
	}
	
}
